﻿using System.Collections.Generic;

namespace Analyze.Service
{
    public class KeywordService
    {
        public static Dictionary<string, double> GetKeywords(string content)
        {
            List<List<object>> keywords = BosonNlpApi.GetKeywords(content);
            var dictionary = new Dictionary<string, double>();
            foreach (var keyword in keywords)
            {
                if (!dictionary.ContainsKey((string) keyword[1]))
                {
                    dictionary.Add((string) keyword[1], (double) keyword[0]);
                }
            }
            return dictionary;
        }
    }
}